<template>
  <master-service :userName="userName"></master-service>
</template>

<script>
  import MasterService from './components/MasterService'
  export default {
    name: "Service",
    components: {
      MasterService
    },
    data () {
      return {
        userName: ''
      }
    },
    methods: {
      getLocalStorageData () {
        const phone = localStorage.getItem('phone');
        this.userName = phone;
        if (!phone) {
          this.$router.push('/');
        }
      }
    },
    created () {
      this.getLocalStorageData();
    }
  }
</script>

<style scoped="scoped">

</style>
